#ifndef _CALCULATE_H
#define _CALCULATE_H
#include "sys.h"

#define ADC_MAX_NUM 2 * 1000
#define ERRORS_NUMS 15
#define VOLTAGE_OFFSET (0.2)
#define VOLTAGE_EARTH (0)
#define VOLTAGE_DIODE (0.7)
#define VOLTAGE_SOURCE (2.5)

extern double Front_Errors[ERRORS_NUMS];
extern double Back_Errors[ERRORS_NUMS];
extern char DetectionMsg[20];
extern char DiodeDetectionMsg[20];

void ADCdetect(void);
void ImportData(void);
float ADC_CH2(void);
void DiodeDetectionAlgo(void);
float abs_float(float a, float b);
void CommonDetect(void);
void DetectionAlgo(void);

#endif